<template>
  <div>login</div>
</template>


<script lang="ts">
import { defineComponent } from 'vue'
import {getMenu} from "@/api/base/index"
import {MenuItem,getAllPath,filterPath,saveRoutes,saveMenus,savePermissions} from "@/config/menu.config"
export default defineComponent({
  methods:{
    async getMenu(){
      try{
        let res = await getMenu();
        
        res  = JSON.parse(res)
        const list:MenuItem[] = res.result;
        console.log(JSON.stringify(list))
        const paths = filterPath(getAllPath(list))
        // console.log(res)
        saveRoutes(list);
        saveMenus(list);
        savePermissions(list);
      }
      catch(e){console.log(e)}
    }
    // 解析 菜单数据
  },
  created(){
    this.getMenu();
  },
  mounted(){
    this.$router.push('/huarun');
  }
})
</script>
